﻿'' ===========================
'' 描述：提供Mail对应的元数据
'' 添加人：李大龙
'' 日期：2010-11-30
'' ===========================

''' <summary>
''' 邮件对象
''' </summary>
''' <remarks></remarks>
Public Class MailItem

    Private _from As MailFrom
    Private _to As List(Of MailTo)

    Private _projectId As String

    ''' <summary>
    ''' 工程编号
    ''' </summary>    
    Public Property ProjectId() As String
        Get
            Return _projectId
        End Get
        Set(ByVal value As String)
            _projectId = value
        End Set
    End Property

    ''' <summary>
    ''' 发送值
    ''' </summary>
    Public Property [TO]() As List(Of MailTo)
        Get
            Return _to
        End Get
        Set(ByVal value As List(Of MailTo))
            _to = value
        End Set
    End Property

    ''' <summary>
    ''' 发送邮件的账户
    ''' </summary>
    Public Property From() As MailFrom
        Get
            Return _from
        End Get
        Set(ByVal value As MailFrom)
            _from = value
        End Set
    End Property

End Class

''' <summary>
''' 接收邮件的对象
''' </summary>
''' <remarks></remarks>
Public Class MailTo
    Private _to As String

    Private _projectId As String

    ''' <summary>
    ''' 工程编号
    ''' </summary>    
    Public Property ProjectId() As String
        Get
            Return _projectId
        End Get
        Set(ByVal value As String)
            _projectId = value
        End Set
    End Property

    ''' <summary>
    ''' 发送值
    ''' </summary>
    Public Property [TO]() As String
        Get
            Return _to
        End Get
        Set(ByVal value As String)
            _to = value
        End Set
    End Property
End Class


''' <summary>
''' 发送邮件的账户
''' </summary>
''' <remarks></remarks>
Public Class MailFrom
    Private _projectId As String

    Private _user As String
    Private _password As String
    Private _smtp As String
    Private _body As String
    Private _subject As String

    ''' <summary>
    ''' 工程编号
    ''' </summary>    
    Public Property ProjectId() As String
        Get
            Return _projectId
        End Get
        Set(ByVal value As String)
            _projectId = value
        End Set
    End Property
    ''' <summary>
    ''' 发送邮件的SMTP服务器
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property SMTP() As String
        Get
            Return _smtp
        End Get
        Set(ByVal value As String)
            _smtp = value
        End Set
    End Property

    ''' <summary>
    ''' 发送邮件的账户
    ''' </summary>
    Public Property Account() As String
        Get
            Return _user
        End Get
        Set(ByVal value As String)
            _user = value
        End Set
    End Property

    ''' <summary>
    ''' 发送邮件的密码
    ''' </summary>
    Public Property Password() As String
        Get
            Return _password
        End Get
        Set(ByVal value As String)
            _password = value
        End Set
    End Property
    ''' <summary>
    ''' 发送时是否需要凭证
    ''' </summary>
    Public ReadOnly Property NeedCredential() As Boolean
        Get
            Return True
        End Get
    End Property

    ''' <summary>
    ''' 邮件主题
    ''' </summary>
    Public Property Body() As String
        Get
            Return _body
        End Get
        Set(ByVal value As String)
            _body = value
        End Set
    End Property


    ''' <summary>
    ''' 发送邮件的主题
    ''' </summary>
    Public Property Subject() As String
        Get
            Return _subject
        End Get
        Set(ByVal value As String)
            _subject = value
        End Set
    End Property
End Class